import request from '@/utils/request'

/**
获取树状机构信息  institution
 */
export function getTreeOrg() {
  return request({
    url: '/manager/business-hall/tree'
  })
}

// /** 根据机构查询快递员*/
// export const getEmployeeByAgencyId = (agencyId) => {
//   return request({
//     url: `/manager/business-hall/courier/findByAgencyId/${agencyId}`
//   })
// }

/** 获取员工pagingData*/
export const getEmployeePagingDataAPI = (params) => {
  return request({
    url: `/manager/business-hall/user/page`,
    params
  })
}

// 运费管理--新增/修改运费模板
export const addEditTemplateAPI = (data) => {
  return request({
    url: `/manager/carriages`,
    method: 'post',
    data
  })
}

// 获取运费模板列表/manager/carriages
export const getTemplateAPI = (params) => {
  return request({
    url: `/manager/carriages`,
    params
  })
}

// 删除运费/manager/carriages/{id}
export const delTemplateAPI = (id) => {
  return request({
    url: `/manager/carriages/${id}`,
    method: 'DELETE'
  })
}
// 获取业务范围/manager/business-hall/scope/{id}/{type}
export const getWorkRangeAPI = ({ id, type }) => {
  return request({
    url: `/manager/business-hall/scope/${id}/${type}`
  })
}

